The Institute of Electrical and Electronics Engineers (IEEE) 802.11 protocol specifies that, in a wireless local area network (WLAN), addressing is performed between wireless terminals based on a Media Access Control (MAC) address, where the MAC address is a physical address of a wireless terminal and is burnt into a network adapter of the wireless terminal. When a message is sent between wireless terminals, a MAC address of a receive end and a MAC address of a transmit end are carried in a MAC message header of the message. In this case, if an eavesdropping device eavesdrops on the message by means of an air interface link, after parsing the message, the eavesdropping device may obtain the MAC address of the transmit end and the MAC address of the receive end of the message, to further acquire user information of the transmit end or the receive end by tracing the MAC address of the transmit end or the MAC address of the receive end, causing leakage of the user information of the transmit end or the receive end.
The problem that an eavesdropping device eavesdrops on a message by means of an air interface link and acquires user information of a transmit end or a receive end is resolved using the following method. The receive end periodically changes a MAC address used to send a message, and sends the changed MAC address to the transmit end in a broadcast manner or the like. In this case, when the transmit end sends a message to the receive end, the transmit end adds the changed MAC address of the receive end and a current MAC address of the transmit end to a MAC message header of the message. In this way, MAC addresses of the receive end that are included in the messages obtained by the eavesdropping device through eavesdropping in different periods are different, and consequently, the eavesdropping device determines that the acquired MAC addresses are MAC addresses of different receive ends, and cannot acquire user information of the receive end by tracing the MAC address of the receive end, thereby ensuring security of the user information of the receive end. Likewise, if a MAC address used by the transmit end when the transmit end currently sends a message is different from an original MAC address, the eavesdropping device cannot acquire user information of the transmit end by tracing the MAC address of the transmit end either, thereby ensuring security of the user information of the transmit end.
However, the foregoing implementation manner is not universal. When a MAC address used when the receive end sends a message is already changed, and the receive end has only one interface of the changed MAC address, when the transmit end sends a message to the receive end, a MAC address of the receive end before change and a current MAC address of the transmit end are carried in a MAC message header of the message. The receive end parses the MAC message header of the message when the receive end receives the message at an interface of the changed MAC address. In this case, the MAC address of the receive end obtained through parsing is not the changed MAC address of the receive end, and the receive end may determine that the message is not sent to the receive end itself, and further does not parse the message. Consequently, the transmit end cannot communicate with the receive end. For example, in a scenario in which a MAC address used when a receive end sends a message is coded by means of a two-dimensional barcode, a transmit end may acquire, by scanning the two-dimensional barcode, the MAC address used when the receive end sends the message, and further performs handshaking with and communicates with the receive end using the MAC address. However, after the MAC address used when the receive end sends the message is changed and the receive end has only one interface of the changed MAC address, the transmit end cannot acquire the changed MAC address of the receive end. Therefore, when the transmit end sends a message to the receive end, the MAC address of the receive end before the change and a current MAC address of the transmit end are carried in a MAC message header of the message. The receive end parses the MAC message header of the message when the receive end receives, at the interface of the changed MAC address, the message sent by the transmit end. In this case, the MAC address of the receive end obtained through parsing is not the changed MAC address of the receive end, and the receive end may determine that the message is not sent to the receive end itself, and further does not parse the message. Consequently, the transmit end cannot communicate with the receive end.